<template>
    <div ref="myChart" id="myChart"></div>
</template>
<script>
import * as echarts from "echarts";
import { mapDataProvince } from "@/assets/mapData";
export default {
    mounted() {
        let myChart = echarts.init(this.$refs.myChart);
        //注册当前使用的地图名
        echarts.registerMap("chinaMap", mapDataProvince);
        let option = {
									geo:{
										//地理坐标组件
										type:'map',
										map:'chinaMap',
										roam:true,//平移
										// zoom:10,
										// centere:[]
										label:{
											show:true,
											color:"white",
											fontSize:15
										},
										itemStyle:{
											areaColor:"#ff6600"
										}
									}
								};
        myChart.setOption(option);
    },
};
</script>
<style scoped>
#myChart {
    width: 500px;
    height: 500px;
    border: 1px solid red;
}
</style>